package com.bw.zhuangao5___day002.Fragment.Home.Fragment1;


import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;

import com.bw.mvp.V.BannerFragment;
import com.bw.zhuangao5___day002.R;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;

import java.util.List;


public class BlankFragmentHome1 extends BannerFragment implements HomeContion.MyviewH {

    public HomePretenter homePretenter;
    public boolean isoos=true;
    public int page=3;
    private SmartRefreshLayout BlankH1Smart;
    private RecyclerView BlankH1Review;
    public   BooHomeAdpter booHomeAdpter;

    @Override
    public int bandLayoud() {
        return R.layout.fragment_blank_fragment_home1;
    }

    @Override
    public void initView() {
        BlankH1Review = (RecyclerView) findViewById(R.id.BlankH1_review);
        BlankH1Review.setLayoutManager(new StaggeredGridLayoutManager(1,StaggeredGridLayoutManager.VERTICAL));
       homePretenter = new HomePretenter( this,new HomeModel());
       homePretenter.initoos();
    }

    @Override
    public void initDate() {


    }

    @Override
    public void getMyviewH(List<JavaHome.ResBean.VerticalBean> hahlist) {
        if (booHomeAdpter==null)
        {
            booHomeAdpter = new BooHomeAdpter(hahlist);
            BlankH1Review.setAdapter(booHomeAdpter);
        }else {
            if (isoos)
            {
                booHomeAdpter.getData().clear();
            }
            booHomeAdpter.getData().addAll(hahlist);
            booHomeAdpter.notifyDataSetChanged();
        }
    }




}
